Intersoft WebTextEditor Documentation
Walkthrough: Using WebFileUploader with AttachmentBar UI
See Also Send Feedback
Intersoft WebTextEditor > WebFileUploader > Features > Rich user experiences > Attachment Layout Mode > Walkthrough: Using WebFileUploader with AttachmentBar UI

Glossary Item Box

This walkthrough shows you AttachmentBar UI in WebFileUploader.

During this walkthrough, you will learn how to do the following:

 Prerequisites

In order to complete this walkthrough, you will need the following:

  • Visual Studio 2008 Application.

 Step-By-Step Instructions

To enable mail merge with custom collection

  1. Launch Visual Studio.NET 2008.
  2. Click on File menu, then select New and click Web Site.
  3. Select ASP.NET Web Site in the Template box and set Location to HTTP.
  4. Named the Web Site and click OK.
  5. Right-click on Project's name and select New Folder.
  6. Named the folder Upload.
  7. Right-click on Project's name and select Add New Item.
  8. Select WebForm in the My Templates box and named it as Walkthrough.aspx.
  9. Drag WebFileUploader instance from ToolBar to WebForm.
  10. Set the UploadPath property to the newly created Upload folder, the value of this property should be ./Upload
  11. Set the WebFileUploader UILayout property to AttachmentBar.
  12. Drag a HTML button from toolbar to WebForm and implement the onClick event to send the file in the WebFileUploader. Here is the snippet:
    Javascript Copy Code
    function Button1_onclick()
    { 
       var wfu = ISGetObject("WebFileUploader1"); 
       if (wfu.IsUploadInProgress()) 
       {      
          alert("Uploading is already in progress. Please wait.");      
          return; 
       } 
       if (wfu.GetValidFilesCount() > 0)      
          wfu.UploadFiles(); 
       else      
          alert("You haven't added any files to the attachment box. Please try to add some files.");
    }
    

    Add some validation in the button click event to check whether upload is in progress and if any file is supplied in the WebFileUploader.

  13. Implement OnError and OnCompleted WebFileUploader client side event to display a message if the upload is completed or any error occurred during upload progress.
    C# Copy Code
    functionupload_Completed(id)
    {   
       alert("The uploading process has completed");
    }
    
    functionupload_Error(id, fileInfo, errorMessage)
    {   
       alert("The uploading process has failed due to error '" + unescape(errorMessage) + "'");
    }
    

  14. Run the sample in a Web Browser.

See Also

Other Resources
{Attachment Layout Mode}

©2013. All Rights Reserved.